home *** CD-ROM | disk | FTP | other *** search
- /* version.c by Michael Hanson */
- /* you may use this, but not for profit, and give me credit */
- /* esc - map string into escaped character if appropriate */
-
- char esc(s,i)
- register char s[];
- int *i;
- {
- int index();
- static char real[] = " \\\b\t\v\f\n\r\(\!\)\^";
- static char symb[] = "s\\btvfnr(!)^";
-
- if(s[*i] != '\\')
- return s[*i];
- if(s[*i] == '\0') /* not special at end */
- return '\\';
- (*i)++;
- real[sizeof(real)-1] = s[*i];
- return real[index(symb, s[*i])];
- }
-